package org.vincen.client5;

import java.util.concurrent.Future;

import org.apache.hello_world_async_soap_http.GreeterAsync;
import org.apache.hello_world_async_soap_http.SOAPService;

public class CallbackClient {

	public static void main(String[] args) {
		SOAPService service = new SOAPService();
		GreeterAsync greet = service.getSoapPort();

		GreetMeSometimeAsyncHandler handler = new GreetMeSometimeAsyncHandler();
		Future<?> future = greet.greetMeSometimeAsync(
				System.getProperty("user.name"), handler);
		
		while (!future.isDone()) {  
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}  
        String reply = handler.getResponse();  
        System.out.println( reply );  
	}
}
